package org.bapoint.create.singleton;

/**
 * @ClassName SingletonSafe
 * @Description TODO
 * @Author 王逸攀
 * @Date 2024/8/6 9:32
 * @Version 1.0
 */
public class SingletonSafe {
    private static volatile SingletonSafe instance = null;

    private SingletonSafe() {
    }

    private static synchronized SingletonSafe getInstance() {
        if (instance == null) {
            synchronized (instance) {
                if (instance == null) {
                    instance = new SingletonSafe();
                }
            }
        }
        return instance;
    }
}
